package com.micro.ai.commons.constant;

/**
 * 错误码常量定义
 * 
 * @author micro-ai
 * @since 0.0.1
 */
public final class ErrorCodeConstants {

    private ErrorCodeConstants() {
        // 工具类不允许实例化
    }

    /**
     * 系统错误码范围：10000-19999
     */
    public static final class System {
        public static final int SYSTEM_ERROR = 10000;
        public static final int PARAM_ERROR = 10001;
        public static final int VALIDATION_ERROR = 10002;
        public static final int JSON_PARSE_ERROR = 10003;
        public static final int FILE_NOT_FOUND = 10004;
        public static final int IO_ERROR = 10005;
        public static final int NETWORK_ERROR = 10006;
        public static final int TIMEOUT_ERROR = 10007;
        public static final int CONCURRENT_ERROR = 10008;
        public static final int RESOURCE_NOT_FOUND = 10009;
    }

    /**
     * 认证授权错误码范围：20000-29999
     */
    public static final class Auth {
        public static final int UNAUTHORIZED = 20000;
        public static final int FORBIDDEN = 20001;
        public static final int TOKEN_EXPIRED = 20002;
        public static final int TOKEN_INVALID = 20003;
        public static final int LOGIN_FAILED = 20004;
        public static final int PASSWORD_ERROR = 20005;
        public static final int ACCOUNT_LOCKED = 20006;
        public static final int ACCOUNT_DISABLED = 20007;
        public static final int PERMISSION_DENIED = 20008;
        public static final int ROLE_NOT_FOUND = 20009;
    }

    /**
     * 业务错误码范围：30000-39999
     */
    public static final class Business {
        public static final int BUSINESS_ERROR = 30000;
        public static final int DATA_NOT_FOUND = 30001;
        public static final int DATA_ALREADY_EXISTS = 30002;
        public static final int DATA_INVALID = 30003;
        public static final int OPERATION_FAILED = 30004;
        public static final int QUOTA_EXCEEDED = 30005;
        public static final int SERVICE_UNAVAILABLE = 30006;
        public static final int RATE_LIMIT_EXCEEDED = 30007;
        public static final int CONFIG_ERROR = 30008;
        public static final int DEPENDENCY_ERROR = 30009;
    }

    /**
     * AI相关错误码范围：40000-49999
     */
    public static final class AI {
        public static final int AI_ERROR = 40000;
        public static final int MODEL_NOT_FOUND = 40001;
        public static final int MODEL_LOAD_FAILED = 40002;
        public static final int INFERENCE_FAILED = 40003;
        public static final int TRAINING_FAILED = 40004;
        public static final int DATA_PREPROCESSING_FAILED = 40005;
        public static final int PREDICTION_FAILED = 40006;
        public static final int MODEL_VERSION_ERROR = 40007;
        public static final int AI_SERVICE_UNAVAILABLE = 40008;
        public static final int AI_QUOTA_EXCEEDED = 40009;
    }

    /**
     * 微服务错误码范围：50000-59999
     */
    public static final class Microservice {
        public static final int SERVICE_ERROR = 50000;
        public static final int SERVICE_UNAVAILABLE = 50001;
        public static final int SERVICE_TIMEOUT = 50002;
        public static final int CIRCUIT_BREAKER_OPEN = 50003;
        public static final int LOAD_BALANCER_ERROR = 50004;
        public static final int SERVICE_DISCOVERY_ERROR = 50005;
        public static final int CONFIG_CENTER_ERROR = 50006;
        public static final int MESSAGE_QUEUE_ERROR = 50007;
        public static final int DATABASE_ERROR = 50008;
        public static final int CACHE_ERROR = 50009;
    }
}
